import { ref, onMounted, computed } from 'vue';

export default function () {
    let sum = ref(0);
    let bigSum = computed(() => {
        return sum.value * 10;
    });
    function add() {
        sum.value += 1;
    }
    // 挂载完毕钩子
    onMounted(() => {
        console.log('sum--挂载完毕');
        sum.value += 100;
    });
    //向外部提供东西
    return { sum, add, bigSum };
}
